//
//  PFTestVCTwo.m
//  PFDevelopKit
//
//  Created by 原鹏飞 on 2018/10/30.
//  Copyright © 2018 ypf. All rights reserved.
//

#import "PFTestVCTwo.h"

@interface PFTestVCTwo ()

@property (nonatomic, strong) UIButton *backBtn;

@end

@implementation PFTestVCTwo

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupUI];
}


- (void)setupUI {
    self.view.backgroundColor = [UIColor greenColor];
    
    _backBtn = [UIButton pf_buttonWithTitle:@"返回" andTitleColor:UIColor.blueColor];
    [self.view addSubview:_backBtn];
    [_backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.view);
        make.height.mas_equalTo(50);
        make.width.mas_equalTo(100);
    }];
    [_backBtn addTarget:self action:@selector(backBtnClick:) forControlEvents:UIControlEventTouchUpInside];
}


- (void)backBtnClick:(UIButton *)sender {
    [self dismissViewControllerAnimated:YES completion:^{
        NSLog(@"我走了哇！");
    }];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
